.main-container {
    display: flex;
    min-height: 100vh;
}

.contact-list {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    background-color: #f8f8f8;
}

.list-container {
    flex: 1;
    overflow-y: auto;
    background-color: white;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-item:hover {
    background-color: #f5f5f5;
}

.contact-item.active {
    background-color: #e6e6e6;
}

.avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.contact-info .username {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-info .last-message {
    font-size: 14px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.last-time {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
    margin-left: 12px;
}

.chat-area {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    background-color: #f0f0f0;
}

.chat-header {
    padding: 12px;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.chat-message {
    display: flex;
    margin-bottom: 12px;
}

.self-message {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
}

.self-message .message-avatar {
    margin-right: 0;
    margin-left: 8px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    background-color: #fff;
    padding: 8px;
    border-radius: 8px;
    max-width: 70%;
}

.self-message .message-content {
    background-color: #dcf8c6;
}

.chat-input {
    display: flex;
    padding: 12px;
    background-color: #fff;
    border-top: 1px solid #ccc;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 8px;
}

.chat-input button {
    padding: 8px 16px;
    background-color: #07c160;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
